#include <iostream>  
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>

void handler(int sig)
{
    std::cout << "get a sig:" << sig << std::endl;
}

int main()
{
    signal(SIGSEGV, handler);
    while(true)
    {
        std::cout << "hello bit, pid: " << getpid() << std::endl;

        int *p = nullptr;
        *p = 10;
    }
    return 0;
}